package com.chutoutian.untils;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.io.support.PropertiesLoaderUtils;

import java.io.IOException;
import java.util.Properties;

/**
 * 配置文件类
 */
public final class PropertiesUtil {

    private static Logger logger = LoggerFactory.getLogger(PropertiesUtil.class);

    private PropertiesUtil() {
    }

    public static String getValue(String path, String key) {
        Properties prop = new Properties();
        try {
            prop = PropertiesLoaderUtils.loadAllProperties(path);
        } catch (IOException e) {
            logger.error("catch Exception", e);
        }

        return prop.getProperty(key);
    }
}
